import React, { Component } from 'react'
import List from './List/list'
import Search from './Search/search'
import './style.css'
export default class App extends Component {
    state = {
        users:[],//用户数据
        state:{
            isFirst:true,//是否第一次登陆
            isLoading:false,//是否加载中
            isErorrMessage:''
        }
    }
    //所有的用户数组
    GetUsers = (usersList) => {
        this.setState({users:usersList})
    }
    //改变状态
    ChanceState = (stateObj) => {
        this.setState({state:stateObj})
    }
    
    render() {
        const { users,state } = this.state
        return (
            <div className='container'>
                <Search GetUsers={this.GetUsers} state={state} ChanceState={this.ChanceState}/>
                <List users={users} state={state}/>
            </div>
        )
    }
}
